= render "projects/settings_nav"
%h3.page_title
  Team Members
  (#{@project.users.count})
  %small
    Read more about project permissions
    %strong= link_to "here", help_permissions_path, class: "vlink"

  - if can? current_user, :admin_team_member, @project
    %span.pull-right
      = link_to import_project_team_members_path(@project), class: "btn btn-small grouped", title: "Import team from another project" do
        Import team from another project
      = link_to available_project_teams_path(@project), class: "btn btn-small grouped", title: "Assign project to team of users" do
        Assign project to Team of users
      = link_to new_project_team_member_path(@project), class: "btn btn-primary small grouped", title: "New Team Member" do
        New Team Member

%hr

.clearfix
.row
  .span3
    %ul.nav.nav-pills.nav-stacked
      %li{class: ("active" if !params[:type])}
        = link_to project_team_index_path(type: nil) do
          All
      %li{class: ("active" if params[:type] == 'masters')}
        = link_to project_team_index_path(type: 'masters') do
          Masters
          %span.pull-right= @project.users_projects.masters.count
      %li{class: ("active" if params[:type] == 'developers')}
        = link_to project_team_index_path(type: 'developers') do
          Developers
          %span.pull-right= @project.users_projects.developers.count
      %li{class: ("active" if params[:type] == 'reporters')}
        = link_to project_team_index_path(type: 'reporters') do
          Reporters
          %span.pull-right= @project.users_projects.reporters.count
      %li{class: ("active" if params[:type] == 'guests')}
        = link_to project_team_index_path(type: 'guests') do
          Guests
          %span.pull-right= @project.users_projects.guests.count

    - if @assigned_teams.present?
      %h5
        Assigned teams
        (#{@project.user_teams.count})
      %div
        = render "team_members/assigned_teams", assigned_teams: @assigned_teams

  .span9
    %div.team-table
      = render "team_members/team", team: @team



